#include <stdio.h>
#include "Nano100Series.h"
#include "MotionSensor.h"
#include "I2C1.h"
#include "Bmx055.h"
#include "Mpu6500.h"
#include "Mmc3630.h"

void MotionSensorInit()
{
#ifdef MOTION_SENSOR_TYPE_BMX055
	Bmx055Init();
#endif

#ifdef MOTION_SENSOR_TYPE_MPU6500
	Mpu6500Init();
#endif
#ifdef MOTION_SENSOR_TYPE_MMC3630
	Mmc3630Init();
#endif
}

void MotionSensorGetAcc(uint8_t *buf, uint32_t n)
{
#ifdef MOTION_SENSOR_TYPE_BMX055
	Bmx055GetAcc(buf, n);
#endif
#ifdef MOTION_SENSOR_TYPE_MPU6500
	Mpu6500GetAcc(buf, n);
#endif
}

void MotionSensorGetGyro(uint8_t *buf, uint32_t n)
{
#ifdef MOTION_SENSOR_TYPE_BMX055
	Bmx055GetGyro(buf, n);
#endif
#ifdef MOTION_SENSOR_TYPE_MPU6500
	Mpu6500GetGyro(buf, n);
#endif
}

void MotionSensorGetMag(uint8_t *buf, uint32_t n)
{
#ifdef MOTION_SENSOR_TYPE_BMX055
	Bmx055GetMag(buf, n);
#endif
#ifdef MOTION_SENSOR_TYPE_MMC3630
	Mmc3630GetMag(buf, n);
#endif
}
